草庐IT

php session 超时

全部标签

spring - 我收到池错误超时等待空闲对象

我在Tomcat服务器中使用上述语句创建了连接池。一些android应用程序正在使用网络服务与我的应用程序连接。通过网络服务,我正在发送和接收一些数据。我收到错误SQLState:null[2013-12-0514:13:06,156]ERROR069688[http-8080-10]-org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:78)-Cannotgetaconnection,poolerrorTimeoutwaitingforidleobject我看到了Conne

spring - 如何在 Spring 5 WebFlux WebClient 中设置超时

我正在尝试在我的WebClient上设置超时,这是当前代码:SslContextsslContext=SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE).build();ClientHttpConnectorhttpConnector=newReactorClientHttpConnector(opt->{opt.sslContext(sslContext);HttpClientOptionsoption=HttpClientOptions.builder().build();

ajax - Spring 安全性 + Ajax session 超时问题

我有一个使用SpringMVC构建的应用程序并使用Spring安全性进行保护,一堆Controller是JSON休息服务,它们都受到保护。我正在使用LoginUrlAuthenticationEntryPoint来检测AJAX请求并在发生session超时时发送403ERRORCODE-所有其他请求都会被重定向回登录页面。下面是SpringSecurityXML片段和authenticationEntryPointjava类。问题是session超时后的第一个AJAX请求,Spring重定向到登录页面并返回登录页面HTML,如果我尝试再次执行AJAX请求(重定向发生后),authent

java - 如果受 hystrix 保护的调用超时,我可以抛出自定义错误吗?

我有一个通过这个外部调用的假客户:@RequestMapping(method=RequestMethod.GET,value="GetResourceA",consumes="application/json")@Cacheable("ResourceA")ListgetResourceA()throwsMyOwnException;在我的application.yml我有这个设置:hystrix:command:default:execution.isolation.thread.timeoutInMilliseconds:1000fallback.enabled:false现在,

java - MockRestServiceServer 在集成测试中模拟后端超时

我正在使用MockRestServiceServer在我的RESTController上编写某种集成测试来模拟后端行为。我现在想要实现的是模拟来自后端的非常慢的响应,这最终会导致我的应用程序超时。似乎可以使用WireMock实现,但目前我想坚持使用MockRestServiceServer。我正在创建这样的服务器:myMock=MockRestServiceServer.createServer(asyncRestTemplate);然后我在mock我的后端行为:myMock.expect(requestTo("http://myfakeurl.blabla")).andExpect(

sql - 我可以为单个查询设置 JDBC 超时吗?

我在Tomcat上有一个Web应用程序,它处理数据库连接池,并使用SpringJDBCTemplate来执行查询。有人要求我实现一个状态页面,该页面将由心跳进程监控以确定服务器是否一切正常。作为其中的一部分,我想做一个数据库查询以确定与数据库的连接是否正常。理想情况下,由于它只是“从'中选择1”,我希望它在10秒内快速返回,以表明如果数据库在那段时间内没有响应则表示失败。但是,我不想将连接更改为正常请求的快速超时。有没有办法使用原始JDBC或SpringJDBC包装器设置每个查询的超时? 最佳答案 在Statement(或Prepa

java - Spring Boot REST API - 请求超时?

我有一个SpringBootREST服务,它有时会在请求中调用第三方服务。我想为我的所有资源设置一个超时时间(比如说5秒),这样如果任何请求处理(整个链,从传入到响应)花费的时间超过5秒,我的Controller就会使用HTTP503而不是实际响应进行响应.如果这只是一个Spring属性,那就太棒了,例如设置spring.mvc.async.request-timeout=5000但我没有任何运气。我也尝试过扩展WebMvcConfigurationSupport并覆盖configureAsyncSupport:@OverridepublicvoidconfigureAsyncSupp

java - 如何在 Spring Security 中启用 session 并设置 session 超时

我是SpringSecurity的新手,我正在开发登录、注销和session超时功能。我已经通过引用this配置了我的代码文档。我的代码如下所示:@Overrideprotectedvoidconfigure(HttpSecurityhttp)throwsException{http.authorizeRequests().antMatchers("/admin/**").access("hasRole('ROLE_USER')").and().formLogin().loginPage("/login").failureUrl("/login?error").usernamePara

Spring Boot Java Config 设置 session 超时

如何在SpringBoot应用程序中配置我的(嵌入式)Tomcatsession超时?publicclassSessionListenerimplementsHttpSessionListener{@OverridepublicvoidsessionCreated(HttpSessionEventse){se.getSession().setMaxInactiveInterval(5*60);}@OverridepublicvoidsessionDestroyed(HttpSessionEventse){}}我有一个SessionListener,但我不知道必须在哪个类中将此Liste

php - 如何将超时设置为无限以避免 php 中的 MongoCursorTimeoutException

我正在运行从mongodb获取数据的php脚本。我有一个非常庞大的数据库,我得到了这个异常..我的mongodb版本是1.6.5PHPFatalerror:Uncaughtexception'MongoCursorTimeoutException'withmessage'cursortimedout(timeout:30000,timeleft:0:0,status:0)我的查询是这样的privatefunctionexecuteRegex($start_date,$end_date,$source,$collection,$db){$criteria=array('date'=>ar